package com.xiaoxi.yygh.hosp.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xiaoxi.yygh.hosp.mapper.HospitalSetMapper;
import com.xiaoxi.yygh.hosp.service.HospitalSetService;
import com.xiaoxi.yygh.model.hosp.HospitalSet;
import org.springframework.stereotype.Service;

@Service
public class HospitalSetServiceImpl extends ServiceImpl<HospitalSetMapper, HospitalSet> implements HospitalSetService {
    // 2.根据传过来的医院编码，查询数据库，查询签名
    @Override
    public String getSignKey(String hospCode) {
        LambdaQueryWrapper<HospitalSet> lqw = new LambdaQueryWrapper<>();
        lqw.eq(HospitalSet::getHoscode, hospCode);
        
        HospitalSet hospitalSet = baseMapper.selectOne(lqw);

        return hospitalSet.getSignKey();
    }
}
